<template>
	<view class="container">
		<view class="header">
			<!-- <view class="toolbar">
				<view class="login-button">登录</view>
				<view class="boolbar-button">
					<u-icon name="setting" color="#666" size="28"></u-icon>
					<u-icon name="more-circle" color="#666" size="28"></u-icon>
				</view>
			</view> -->
			<view class="user">
				<view class="head">
					<image :src="user.avatarUrl" class="head-img"></image>
				</view>
				<view class="info">
					<view class="name">{{ user.nickName }}</view>
					<!-- <view class="button">
						<u-icon name="edit-pen" labelPos="left" color="#fff" size="14"></u-icon>
						<u-icon name="arrow-right" labelPos="left" color="#fff" size="14" label="完善个人资料"
							labelColor="#fff"></u-icon>
					</view> -->
				</view>
			</view>
		</view>

		<!-- <view class="my-wealth">
			<view class="item">
				<view class="total">295</view>
				<view class="title">积分</view>
			</view>
			<view class="item">
				<view class="total">295</view>
				<view class="title">推荐币</view>
			</view>
			<view class="item">
				<view class="total">295天</view>
				<view class="title">打卡</view>
			</view>
		</view> -->
		
		<view class="box">
			<!-- <view class="code">
				<view class="title">邀请码</view>
			</view> -->
			<view class="list">
				<view class="item" @click="toProgress">
					<u-icon name="hourglass" color="#6e6f76"  labelPos="bottom" size="50" label="学习进度总览"></u-icon>
				</view>
				<view class="item" @click="toSuggest">
					<u-icon name="edit-pen" color="#6e6f76"  labelPos="bottom" size="50" label="意见反馈"></u-icon>
				</view>
				<view class="item" @click="toInstructions">
					<u-icon name="coupon" color="#6e6f76"  labelPos="bottom" size="50" label="使用说明"></u-icon>
				</view>
				
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				user:{}
			}
		},
		onShareAppMessage(res){
			return this.$utils.onShareAppMessage();
		},
		onLoad() {
			this.user = uni.getStorageSync('user')
		},
		methods: {
			toProgress(){
				uni.navigateTo({
					url:`/pages/progress/index`
				})
			},
			toSuggest(){
				uni.navigateTo({
					url:`/pages/suggest/index`
				})
			},
			toInstructions(){
				uni.navigateTo({
					url:`/pages/instructions/index`
				})
			}
		}
	}
</script>
<style>
	page{
		background-color: #f1eff2;
	}
</style>
<style scoped lang="scss">
	.header {
		background-color: #d6d5e7;
		overflow: hidden;
		padding-top: 40rpx;
		padding-bottom: 70rpx;

		.toolbar {
			display: flex;
			justify-content: space-between;
			padding: 0 30px;
			margin-top: 30rpx;

			.boolbar-button {
				display: flex;
			}
		}

		.user {
			display: flex;
			flex-wrap: wrap;
			width: 80%;
			margin: 0 auto;
			margin-top: 30rpx;

			.head-img {
				width: 110rpx;
				height: 110rpx;
				border-radius: 50%;
				border: 1rpx solid #91919f;
			}

			.info {
				margin-left: 20rpx;
				display:flex;
				align-items: center;
				.name {
					color: #6e6f76;
					font-weight: bold;
				}

				.button {
					display: flex;
					flex-wrap: wrap;
					margin-top: 20rpx;
					background-color: #9595a4;
					border-radius: 40rpx;
					padding: 10rpx;
					opacity: 0.5;
				}
			}

		}
	}



	.my-wealth {
		display: flex;
		justify-content: space-between;
		background-color: #3e3b43;
		border-top-left-radius: 50rpx;
		border-top-right-radius: 50rpx;
		padding:120rpx 0;
		margin-top: -30rpx;
		.item{
			width:33.33%;
			text-align: center;
			border-left:1rpx solid #fff;
			.title{
				color:#fff;
			}
			.total{
				color:#fff;
				font-size:32rpx;
			}
		}
		.item:first-child{
			border:none
		}
	}
	
	.box{
		background-color: #f1eff2;
		border-radius:40rpx;
		position: relative;
		z-index: 2;
		margin-top:-30rpx;
		.code{
			width:200rpx;
			height:200rpx;
			background-color: #fff;
			border-radius:30rpx;
			margin:0 auto;
			position: relative;
			top:-30rpx;
			.title{
				text-align: center;
				line-height: 1;
				padding:10rpx 0;
				font-size:28rpx;
				color:#5e5b5f
			}
		}
		.list{
			display: flex;
			flex-wrap: wrap;
			padding:30rpx 0;
			.item{
				width:calc(50% - 1rpx);
				text-align: center;
				padding:30rpx 0;
			}
			.item:nth-child(1){
				border-right:1rpx solid #e3e3e3;
				border-bottom:1rpx solid #e3e3e3;
			}
			.item:nth-child(3){
				border-right:1rpx solid #e3e3e3;
			}
			.item:nth-child(2){
				border-bottom:1rpx solid #e3e3e3;
			}
		}
	}
</style>
